import http from '@/axios/http.ts'
import { userInfoQueryRequest, createUserInfoRequest, updateUserInfoRequest } from '../models/platformModel'

/**
 * 获取数据库
 * @param {*} p 
 * @returns 
 */
export const getArchiveTable = () => {
    return http.get('/Home/GetArchiveTable');
}

/**
 * 获取角色列表
 * @param {*} p 
 * @returns 
 */
export const getRoleList = () => {
    return http.get('/Permissions/GetRoleList');
}

/**
 * 获取所有角色
 * @param {*} p 
 * @returns 
 */
export const getRoleAllList = () => {
    return http.get('/Permissions/GetRoleAllList');
}

/**
 * 获取系统用户
 * @param {*} p 
 * @returns 
 */
export const getUserList = (pamars: userInfoQueryRequest) => {
    return http.get('/Sys_User/GetUserList', pamars);
}

/**
 * 创建系统用户
 * @param {*} p 
 * @returns 
 */
export const createUser = (pamars: createUserInfoRequest) => {
    return http.post('/Sys_User/CreateUser', pamars);
}

/**
 * 删除用户
 * @param {*} p 
 * @returns 
 */
export const deleteUserById = (pamars: String) => {
    return http.del('/Sys_User/DeleteUserById', pamars);
}

/**
 * 根据id获取用户信息
 * @param {*} p 
 * @returns 
 */
export const getUserById = (pamars: String) => {
    return http.get('/Sys_User/GetUserById', pamars);
}
/**
 * 修改用户
 * @param {*} p 
 * @returns 
 */
export const updateUser = (pamars: updateUserInfoRequest) => {
    return http.post('/Sys_User/UpdateUser', pamars);
}

/**
 * 获取用户默认头像
 * @param {*} p 
 * @returns 
 */
export const getDefUserHead = () => {
    return http.get('/Sys_User/GetDefUserHead');
}
